<div id="viewblock_<?php echo $this->getAttachmentField()->getFieldname(); ?>">
    <?php if ($this->getValue()): ?>
        <strong><?php echo date(Mage::helper('amorderattach')->getViewDateFormat(), strtotime($this->getValue())); ?></strong>
    <?php endif; ?>
</div>

<div id="editblock_<?php echo $this->getAttachmentField()->getFieldname(); ?>" style="display: none;">
    <?php 
    $form = new Varien_Data_Form();
    $date = new Varien_Data_Form_Element_Date(array('image'         => $this->getSkinUrl('images/grid-cal.gif'),
                                                    'html_id'       => 'value_' . $this->getAttachmentField()->getFieldname(),
                                                    'name'          => 'value_' . $this->getAttachmentField()->getFieldname(),
                                                    'input_format'  => Varien_Date::DATE_INTERNAL_FORMAT,
                                                    'format'        => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_LONG)
                ));
    $date->setForm($form);
    $date->setValue($this->getValue());
    echo $date->toHtml();
    ?>
    <div style="margin-top: 2px;">
        <button class="scalable" type="button" onclick="javascript: attachSave('<?php echo $this->getAttachmentField()->getFieldname(); ?>', 'date');">
            <span><?php echo $this->__('Save'); ?></span>
        </button>
        <button class="scalable" type="button" onclick="javascript: attachCancel('<?php echo $this->getAttachmentField()->getFieldname(); ?>');">
            <span><?php echo $this->__('Cancel'); ?></span>
        </button>
    </div>
</div>